package com.qaml.mes.device.domain.service;

import com.qaml.mes.device.api.CheckUpkeepRecordItemService;
import com.qaml.mes.device.dao.CheckUpkeepRecordItemDO;
import com.qaml.mes.device.repository.CheckUpkeepRecordItemRepository;
import com.qaml.mes.device.domain.convert.CheckUpkeepRecordItemConvert;
import com.qaml.mes.device.vo.eqp.CheckUpkeepRecordItemVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName CheckUpkeepRecordItemServiceImpl
 * @Description 检保记录条目
 * @Author leikai
 * @Date 2024/2/28 0028 17:13
 * @Version 1.0
 */
@Service
public class CheckUpkeepRecordItemServiceImpl implements CheckUpkeepRecordItemService {

    @Resource
    private CheckUpkeepRecordItemRepository checkUpkeepRecordItemRepository;

    /**
     * 根据检保任务id获取检保任务条目
     *
     * @param checkUpkeepRecordId 检保任务id
     * @return 检保任务条目
     */
    @Override
    public List<CheckUpkeepRecordItemVO> getByCheckUpkeepRecordId(String checkUpkeepRecordId) {

        List<CheckUpkeepRecordItemDO> checkUpkeepRecordItemDOList = checkUpkeepRecordItemRepository.getByCheckUpkeepRecordId(checkUpkeepRecordId);
        return CheckUpkeepRecordItemConvert.INSTANCE.toVOlist(checkUpkeepRecordItemDOList);
    }
}